﻿using System;
//using Wizard.Runtime;

namespace Wizard.Functions
{
    using Wizard.Runtime;

    internal abstract class Neg<K> : OneParam<K, K>
    {
        public Neg(IHasValue<K> param1)
            : base("Neg", FunctionType.@operator, param1)
        {
        }
    }

    internal class Int32Neg : Neg<Int32>
    {
        public Int32Neg(IHasValue<Int32> param1)
            : base(param1)
        {
        }

        protected override Int32 RecalcValue(IRunContext context)
        {
            return -(mParam1.Value(context));
        }
    }

    internal class DoubleNeg : Neg<double>
    {
        public DoubleNeg(IHasValue<double> param1)
            : base(param1)
        {
        }

        protected override double RecalcValue(IRunContext context)
        {
            return -(mParam1.Value(context));
        }
    }

}